class Solution {
public:
    int findContentChildren(vector<int>& g, vector<int>& s) {
        sort(g.begin(), g.end());
        sort(s.begin(), s.end());
        int cur1 = 0, cur2 = 0, sz1 = g.size(), sz2 = s.size(), ret = 0;
        while(cur1 < sz1 && cur2 < sz2)
        {
            if(s[cur2] >= g[cur1])
                ++ret, ++cur1, ++cur2;
            else
                ++cur2;
        }
        return ret;
    }
};